﻿using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApp1
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private int _currentPage = 1;

        public MainWindow()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            _currentPage++;
            var newContent = CreatePageContent();
            transitionControl.Content = newContent;

        }
        private FrameworkElement CreatePageContent()
        {
            return new Border
            {
                Background = _currentPage % 2 == 0 ? Brushes.Orange : Brushes.LightGreen,
                CornerRadius = new CornerRadius(8),
                Child = new Button
                {
                    Content = $"内容页面 {_currentPage}",
                    FontSize = 24,
                    Background = Brushes.Transparent,
                    BorderThickness = new Thickness(0)
                }
            };
        }
    }
}